package com.mogujie.tt.ui.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.mogujie.tt.R;
import com.mogujie.tt.app.IMApplication;
import com.mogujie.tt.imservice.support.IMServiceConnector;
import com.mogujie.tt.ui.activity.CreateGesturePasswordActivity;
import com.mogujie.tt.ui.base.TTBaseFragment;

/**
 * Created by Administrator on 2015/10/23.
 */
public class GuideGesturePasswordFragment extends TTBaseFragment {

    private View curView = null;

    private IMServiceConnector imServiceConnector = new IMServiceConnector(){
        @Override
        public void onIMServiceConnected() {
            logger.d("config#onIMServiceConnected");
        }

        @Override
        public void onServiceDisconnected() {
        }
    };
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup vg, Bundle bundle) {
        imServiceConnector.connect(this.getActivity());
        if (null != curView) {
            ((ViewGroup) curView.getParent()).removeView(curView);
            return curView;
        }
        curView = inflater.inflate(R.layout.tt_fragment_guidegesturepassword, topContentView);
        initRes();
        return curView;
    }

    private void initRes() {
        hideTopBar();

        curView.findViewById(R.id.gesturepwd_guide_btn).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
               // IMApplication.getInstance().getLockPatternUtils().clearLock();
                Intent intent = new Intent(getActivity(),
                        CreateGesturePasswordActivity.class);
                //打开新的Activity
                startActivity(intent);
                getActivity().finish();
            }
        });

    }

    @Override
    protected void initHandler() {

    }
}
